package frc.circuitrunners;
import edu.wpi.first.wpilibj.Victor;

/**
 * @author CircuitRunners
 * This package and class contains all implementation of the Fetcher code
 */
public class Conveyor extends frc.circuitrunners.RobotSubsystem {
    
    private static Victor Conveyor, ConveyorPanel; //victor module for the roller motors
    
    /*initializes the subsystem*/
    public void init() {
        Conveyor = new Victor(6);
        
    }
    
    public void uptake(boolean run){
        if(run){
            Conveyor.set(1.0);
        } else {
            Conveyor.set(0.0);
        }
    }
    
     /*autonomous implementation of Fetcher subsystem*/
    public void autonomous() {
        switch(stage){
            
        }
    }
        
    //Tele-operated implementation of Fetcher subsystem
    public void teleop(){
        if(IO.getJoystickButton(IO.JOY_DRIVE, 2)){
            Conveyor.set(1.0);
        }
        if(IO.getJoystickButton(IO.JOY_SHOOTER, 5)){
            ConveyorPanel.set(0.2);
        } else if(IO.getJoystickButton(IO.JOY_SHOOTER, 3)){
            ConveyorPanel.set(-0.2);
        } else {
            ConveyorPanel.set(0.0);
        }
    }
    
    /*disabling the robot should stop the roller and IR sensor*/
    public void disable(){
        Conveyor.set(0);
    }
    
    public void autoAim() {
        teleop();
    }

    public void autoBalance() {
        disable();
    }
    
}
